package com.mrwang.api;

import com.mrwang.PageResult;
import com.mrwang.pojo.Sku;
import com.mrwang.pojo.SpuDetail;
import com.mrwang.pojo.SpuVo;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface GoodsApi {
    @GetMapping("spu/page")
    PageResult<SpuVo> spuVoPage(
            @RequestParam(value = "key",required = false)String key,
            @RequestParam(value = "saleable",required = false) Boolean saleable,
            @RequestParam(value = "page",defaultValue = "1") Integer page,
            @RequestParam(value = "rows",defaultValue = "5") Integer rows
    );

    @GetMapping("spu/detail/{spuId}")
    SpuDetail spudetailBySpuId(@PathVariable("spuId") Long spuId);

    @GetMapping("sku/list")
    List<Sku> skuListBySpuId(@RequestParam("id") Long id);

}
